package cn.edu.dz.inner;

public class Student {

    //属性
    private  int stuNo;
    private  String stuName;
    private  boolean sex;

    // 创建成员内部类
    public  class Game{
        public void doSometing(){
            System.out.println("打排位");
        }
    }

    //构造
    public Student() {
    }

    public Student(int stuNo, String stuName, boolean sex) {
        this.stuNo = stuNo;
        this.stuName = stuName;
        this.sex = sex;
    }

    // 方法
    public  void studing(){
        System.out.println("我在学习");

        Game g1 =new Game();  //成员内部类
    }


    public  void eatting(){


        System.out.println("我在吃饭");

         class Sleep {
             void doSometing() {
                 System.out.println("我是局部内部类");
             }
         }
             Sleep sleep =new Sleep();
             sleep.doSometing();

    }
    public  void playing(){
        System.out.println("我在打游戏");

        //匿名内部类
        new Team(){
            @Override
            public void playGame() {
                System.out.println("打豆豆");
            }
        }.playGame();
    }

}
